/**
 * www.mbaobao.com Inc.
 * Copyright (c) 2014 All Rights Reserved.
 */
package top.rushpeak.edu03.core.mq;

import java.util.ArrayList;
import java.util.List;

/**
 *                       
 * @Filename MbbEventEnum.java
 *
 * @Description 
 *
 * @Version 1.0
 *
 * @Author fred
 *
 * @Email kuci@mbaobao.com
 *       
 * @History
 *<li>Author: fred</li>
 *<li>Date: 2014-12-5</li>
 *<li>Version: 1.0</li>
 *<li>Content: create</li>
 *
 */
public enum EventEnum {
	

	TEST1("TEST1", "测试1"),TEST2("TEST2","测试2");
																					
	private String	code;
	private String	message;
					
	/**
	 * 构建一个<code>ShOrderStatus.java</code>
	 * @param code
	 * @param message
	 */
	private EventEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}
	
	public String getCode() {
		return code;
	}
	
	public String getMessage() {
		return message;
	}
	
	public String code() {
		return code;
	}
	
	public String message() {
		return message;
	}
	
	/**
	 * 通过枚举<code>code</code>获得枚举
	 *
	 * @param code
	 * @return AccountStatusEnum
	 */
	public static EventEnum getByCode(String code) {
		for (EventEnum cacheCode : values()) {
			if (cacheCode.getCode().equals(code)) {
				return cacheCode;
			}
		}
		return null;
	}
	
	/**
	 * 获取全部枚举
	 * 
	 * @return List<AccountStatusEnum>
	 */
	public static List<EventEnum> getAllEnum() {
		List<EventEnum> list = new ArrayList<EventEnum>();
		for (EventEnum cache : values()) {
			list.add(cache);
		}
		return list;
	}
	
	/**
	 * 获取全部枚举值
	 * 
	 * @return List<String>
	 */
	public static List<String> getAllEnumCode() {
		List<String> list = new ArrayList<String>();
		for (EventEnum cache : values()) {
			list.add(cache.code());
		}
		return list;
	}
	
}
